﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace EBA.IoC
{
    /// <summary>
    /// 分支节点集合
    /// </summary>
    [ConfigurationCollection(typeof(AssemblyConfigurationElement), AddItemName = "add", CollectionType = ConfigurationElementCollectionType.BasicMap)]
    public class AssemblyConfigurationElementCollection : ConfigurationElementCollection
    {
        /// <summary>
        /// 创建新节点内容
        /// </summary>
        /// <returns></returns>
        protected override ConfigurationElement CreateNewElement()
        {
            return new AssemblyConfigurationElement();
        }

        /// <summary>
        /// 获取内容
        /// </summary>
        /// <param name="element"></param>
        /// <returns></returns>
        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((AssemblyConfigurationElement)element).Assembly;
        }
    }
}
